package com.share.order.api;

import com.share.common.core.constant.SecurityConstants;
import com.share.common.core.constant.ServiceNameConstants;

import com.share.common.core.domain.R;
import com.share.order.domain.OrderInfo;
import com.share.order.domain.OrderSqlVo;
import com.share.order.factory.RemoteOrderInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 用户服务
 *
 * @author share
 */
@FeignClient(contextId = "remoteOrderInfoService", value = ServiceNameConstants.SHARE_ORDER, fallbackFactory = RemoteOrderInfoFallbackFactory.class)
public interface RemoteOrderInfoService {

    /**
     * 获取未完成订单
     */
    @GetMapping("/orderInfo/getNoFinishOrder/{userId}")
    public R<OrderInfo> getNoFinishOrder(@PathVariable("userId") Long userId);


    /** 根据订单号获取订单信息*/
    @GetMapping("/orderInfo/getByOrderNo/{orderNo}")
    public R<OrderInfo> getByOrderNo(@PathVariable("orderNo") String orderNo);


    /** 根据传来的sql语句查询数据库*/
    @PostMapping("/orderInfo/getOrderCount")
    public R getOrderCount(@RequestBody OrderSqlVo orderSqlVo);
}
